<html>
<head><meta charset="utf-8"><title>How to create an executable accessing `rustc_private`? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html">How to create an executable accessing `rustc_private`?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216185691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216185691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216185691">(Nov 10 2020 at 09:04)</a>:</h4>
<p>I am trying to build a new tool that will re-use the internal machinery of rustc. As such I need to be able to use <code>extern crate rustc_*</code>. At first I thought that <code>#![feature(rustc_private)]</code> was enough (it seems it is for lib), but it isn't enough for binaries).</p>



<a name="216187308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216187308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216187308">(Nov 10 2020 at 09:21)</a>:</h4>
<p>You need to install both the <code>rustc-dev</code> and <code>llvm-tools-preview</code> rustup components. The former depends on the later, but rustup doesn't have a way to state such dependency.</p>



<a name="216187322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216187322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216187322">(Nov 10 2020 at 09:21)</a>:</h4>
<p>If that doesn't fix it, can you show the error?</p>



<a name="216190081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216190081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216190081">(Nov 10 2020 at 09:52)</a>:</h4>
<p>here as well another possibly interesting example in <a href="https://github.com/rust-lang/miri/blob/master/rustup-toolchain">miri</a> using CI artifacts (and the rustup components bjorn3 mentioned) to build their driver</p>



<a name="216190529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216190529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216190529">(Nov 10 2020 at 09:57)</a>:</h4>
<p>Great, it worked! EDIT: to add <code>rustc-dev</code> + <code>llvm-tools-preview</code></p>



<a name="216235047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216235047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216235047">(Nov 10 2020 at 16:20)</a>:</h4>
<p>I didn't realized that my builds, but don't run. I get the following error:</p>
<div class="codehilite"><pre><span></span><code>$ cargo run -- test/test1/src/main.rs
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/cargo-callgraph test/test1/src/main.rs`
error[E0463]: can&#39;t find crate for `std`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
</code></pre></div>
<p>What I don' t understand is if I do <code>cargo install --path .</code> (given that the name of the crate and binary have been renamed to <code>cargo-callgraph</code>,  I don't get the same error with the installed version:</p>
<div class="codehilite"><pre><span></span><code>cargo callgraph test/test1/src/main.rs
error: too many file operands
</code></pre></div>
<p>Note: In both case, the <code>--help</code> option works, and is effectively the <code>help</code> of my modified <code>rustdoc</code>.</p>



<a name="216236198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216236198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216236198">(Nov 10 2020 at 16:28)</a>:</h4>
<p>It sounds like the sysroot is wrong</p>



<a name="216236230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216236230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216236230">(Nov 10 2020 at 16:28)</a>:</h4>
<p>Try seeing if <code>cargo run -v</code> passes a --sysroot flag</p>



<a name="216236287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216236287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216236287">(Nov 10 2020 at 16:28)</a>:</h4>
<p>I saw this word multiple times, but I don't know what it refers to: "sysroot"</p>



<a name="216236367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216236367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216236367">(Nov 10 2020 at 16:29)</a>:</h4>
<p>It doesn't seems so:</p>
<div class="codehilite"><pre><span></span><code>$ cargo run -v -- test/test1/src/main.rs
       Fresh cfg-if v0.1.10
       Fresh autocfg v1.0.1
       Fresh lazy_static v1.4.0
       Fresh unicode-xid v0.2.1
       Fresh scopeguard v1.1.0
       Fresh version_check v0.9.2
       Fresh ppv-lite86 v0.2.10
       Fresh either v1.6.1
       Fresh macro-utils v0.1.3
       Fresh itoa v0.4.6
       Fresh regex-syntax v0.6.21
       Fresh pin-project-lite v0.1.11
       Fresh remove_dir_all v0.5.3
       Fresh smallvec v1.4.2
       Fresh crossbeam-utils v0.6.6
       Fresh tracing-core v0.1.17
       Fresh thread_local v1.0.1
       Fresh itertools v0.9.0
       Fresh minifier v0.0.33
       Fresh crossbeam-queue v0.1.2
       Fresh libc v0.2.80
       Fresh proc-macro2 v1.0.24
       Fresh maybe-uninit v2.0.0
       Fresh memchr v2.3.4
       Fresh bitflags v1.2.1
       Fresh ryu v1.0.5
       Fresh crossbeam-utils v0.7.2
       Fresh memoffset v0.5.6
       Fresh getrandom v0.1.15
       Fresh num_cpus v1.13.0
       Fresh quote v1.0.7
       Fresh unicase v2.6.0
       Fresh aho-corasick v0.7.15
       Fresh crossbeam-epoch v0.8.2
       Fresh rand_core v0.5.1
       Fresh syn v1.0.48
       Fresh pulldown-cmark v0.8.0
       Fresh crossbeam-deque v0.7.3
       Fresh regex v1.4.2
       Fresh serde_derive v1.0.117
       Fresh rand_chacha v0.2.2
       Fresh tracing-attributes v0.1.11
       Fresh serde v1.0.117
       Fresh rand v0.7.3
       Fresh tracing v0.1.21
       Fresh serde_json v1.0.59
       Fresh tempfile v3.1.0
       Fresh rustc-rayon-core v0.3.0
       Fresh rustc-rayon v0.3.0
       Fresh cargo-callgraph v0.0.0 (/home/robin/dev/cargo-callgraph)
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/cargo-callgraph test/test1/src/main.rs`
error[E0463]: can&#39;t find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
</code></pre></div>



<a name="216237662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216237662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216237662">(Nov 10 2020 at 16:38)</a>:</h4>
<p>Add <code>--sysroot $(rustc --print sysroot)</code> as argument.</p>



<a name="216237812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216237812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216237812">(Nov 10 2020 at 16:39)</a>:</h4>
<p>Rustc normally finds the sysroot relative to it's own location. Your custom driver isn't part of the sysroot, so rustc_driver doesn't know where to look for the sysroot.</p>



<a name="216237816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216237816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216237816">(Nov 10 2020 at 16:39)</a>:</h4>
<p>YES! it works perfectly <span aria-label="happy" class="emoji emoji-1f600" role="img" title="happy">:happy:</span></p>



<a name="216237966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216237966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216237966">(Nov 10 2020 at 16:40)</a>:</h4>
<p>What should I do to register it? use the one returned by rustc? Should I invoque <code>rustc --print sysroot</code> at runtime?</p>



<a name="216237990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216237990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216237990">(Nov 10 2020 at 16:40)</a>:</h4>
<p>If you don't want to pass the sysroot every time, you can for example copy <a href="https://github.com/rust-lang/miri/blob/master/src/bin/miri.rs#L115-L152">https://github.com/rust-lang/miri/blob/master/src/bin/miri.rs#L115-L152</a></p>



<a name="216238474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216238474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216238474">(Nov 10 2020 at 16:44)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> The sysroot contains the compiler, the standard libraries (for each target), and other tools and things.  You can view the directory with <code>rustc --print=sysroot</code>.</p>
<p>I'm not sure what your executable is doing, but I suspect the issue is configuring the LD_LIBRARY_PATH.  When run from <code>cargo run</code>, cargo sets up a very specific LD_LIBRARY_PATH that points into the <code>target</code> directory.  When run via <code>cargo callgraph</code> (with the space), this is running rustup's <code>cargo</code> proxy which sets up LD_LIBRARY_PATH to include the sysroot.  That's why the two differ.  I'm not sure what your program is doing, so I can't really help beyond that.</p>



<a name="216238570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216238570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216238570">(Nov 10 2020 at 16:45)</a>:</h4>
<p>Oops, just saw bjorn3 responded. <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="216238786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216238786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216238786">(Nov 10 2020 at 16:46)</a>:</h4>
<p>my program is just a modified <code>rustdoc</code> with some extra <code>println!()</code>! Nothing fancy. I'm really surprised at how hard it is to build, link and run <code>rustdoc</code> using only cargo</p>



<a name="216239174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216239174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216239174">(Nov 10 2020 at 16:49)</a>:</h4>
<p><del>I'm suprised you got it to work at all</del></p>



<a name="216239434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216239434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216239434">(Nov 10 2020 at 16:50)</a>:</h4>
<p><span aria-label="rofl" class="emoji emoji-1f923" role="img" title="rofl">:rofl:</span></p>



<a name="216239521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216239521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216239521">(Nov 10 2020 at 16:51)</a>:</h4>
<p>although actually if you have a copy of the current state that would be really helpful, I've been discussing with <span class="user-mention silent" data-user-id="132040">Manish Goregaokar</span> how to build rustdoc out of tree</p>



<a name="216239829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216239829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216239829">(Nov 10 2020 at 16:53)</a>:</h4>
<p>I only modified the <code>Cargo.toml</code>:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml</span>
<span class="gh">index b0f5bac6abd..9724c10e1ae 100644</span>
<span class="gd">--- a/src/librustdoc/Cargo.toml</span>
<span class="gi">+++ b/src/librustdoc/Cargo.toml</span>
<span class="gu">@@ -4,8 +4,9 @@ name = "rustdoc"</span>
 version = "0.0.0"
 edition = "2018"

<span class="gd">-[lib]</span>
<span class="gi">+[[bin]]</span>
 path = "lib.rs"
<span class="gi">+name = "rustdoc"</span>

 [dependencies]
 pulldown-cmark = { version = "0.8", default-features = false }
<span class="gu">@@ -17,6 +18,8 @@ smallvec = "1.0"</span>
 tempfile = "3"
 itertools = "0.9"
 regex = "1"
<span class="gi">+lazy_static = "1.4.0"</span>
<span class="gi">+tracing = "0.1.21"</span>

 [dev-dependencies]
 expect-test = "1.0"
</code></pre></div>
<p>\\+ added the above modification to have a working sysroot</p>



<a name="216239921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216239921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216239921">(Nov 10 2020 at 16:54)</a>:</h4>
<p>nice, that's not bad at all</p>



<a name="216239973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216239973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216239973">(Nov 10 2020 at 16:54)</a>:</h4>
<p>It's just ultra long to do, given that I have no idea of what to do, or what error message means</p>



<a name="216240067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240067">(Nov 10 2020 at 16:55)</a>:</h4>
<p>and I had to install the rustup component <code>rustc-dev</code> and <code>llvm-tools-preview</code></p>



<a name="216240160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240160">(Nov 10 2020 at 16:56)</a>:</h4>
<p>yeah the build system could be better :/</p>



<a name="216240410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240410">(Nov 10 2020 at 16:57)</a>:</h4>
<p>You mean "the build system could be <code>Cargo</code>, like 100% of Rust project, and not some homemade half-broken never-seen-anywhere-else build system like 100% of C++ project".</p>



<a name="216240430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240430">(Nov 10 2020 at 16:57)</a>:</h4>
<p>well no, it can't be cargo</p>



<a name="216240435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240435">(Nov 10 2020 at 16:57)</a>:</h4>
<p>cargo can't do multi-stage builds</p>



<a name="216240556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240556">(Nov 10 2020 at 16:58)</a>:</h4>
<p>one sec</p>



<a name="216240631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240631">(Nov 10 2020 at 16:59)</a>:</h4>
<p>Can't it be a script (let's name it <code>x.py</code>) that invoke <code>Cargo</code> multiple times (to be able to boostrap it), but if you have a very-very up-to-date cargo, you could just use cargo?</p>



<a name="216240668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240668">(Nov 10 2020 at 16:59)</a>:</h4>
<p>you need to bootstrap rustc itself, not just cargo</p>



<a name="216240690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240690">(Nov 10 2020 at 16:59)</a>:</h4>
<p>but otherwise yes, that's basically what x.py does</p>



<a name="216240799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240799">(Nov 10 2020 at 17:00)</a>:</h4>
<p>I don't mind <code>x.py</code>, I just don't like at all that I can't use <code>Cargo</code> to build the version N+1 of the compiler + tools, assuming that my current toolchain is the version N.</p>



<a name="216240837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240837">(Nov 10 2020 at 17:00)</a>:</h4>
<p>I think <span class="user-mention silent" data-user-id="281841">Robin Moussu</span> means "add a Cargo feature"?</p>



<a name="216240879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216240879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216240879">(Nov 10 2020 at 17:00)</a>:</h4>
<p>There are a lot of platform specific things done by rustbuild that most people don't need. It also handles LLVM compilation in such a way that it only has to be compiled once instead of once for each stage.</p>



<a name="216241008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241008">(Nov 10 2020 at 17:01)</a>:</h4>
<p>here we go: <a href="https://www.reddit.com/r/rust/comments/irhj4o/blog_post_rust_in_2021/g4yvujq/?utm_source=reddit&amp;utm_medium=web2x&amp;context=3">https://www.reddit.com/r/rust/comments/irhj4o/blog_post_rust_in_2021/g4yvujq/?utm_source=reddit&amp;utm_medium=web2x&amp;context=3</a></p>



<a name="216241269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241269">(Nov 10 2020 at 17:03)</a>:</h4>
<p>oh I see you commented there:</p>
<blockquote>
<p>Having a python or shell script that download rustup, then cargo nightly, then run cargo test is also totally fine as long as you don't need it at all if you already have access to cargo nightly.</p>
</blockquote>
<p>this doesn't work naively because you have two different versions of the standard library in play <a href="https://github.com/rust-lang/rust/pull/68692#discussion_r390567689">https://github.com/rust-lang/rust/pull/68692#discussion_r390567689</a></p>



<a name="216241274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241274">(Nov 10 2020 at 17:03)</a>:</h4>
<p>yes, I read it</p>



<a name="216241506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241506">(Nov 10 2020 at 17:05)</a>:</h4>
<p>rustbuild also needs to use the bootstrap compiler to compile build scripts in all cases as the main compiler may not yet have a sysroot compiled. (would be nice if the sysroot didn't require build scripts by the way)</p>



<a name="216241571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241571">(Nov 10 2020 at 17:05)</a>:</h4>
<p>anyway, I 100% think x.py could be better and easier to use, but it's really frustrating when people say 'just use cargo' without understanding the problems x.py tries to solve</p>



<a name="216241758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241758">(Nov 10 2020 at 17:07)</a>:</h4>
<p>cargo doesn't know anything about submodules for instance <a href="https://github.com/rust-lang/rust/issues/76653">https://github.com/rust-lang/rust/issues/76653</a></p>



<a name="216241788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241788">(Nov 10 2020 at 17:07)</a>:</h4>
<p>and despite that gets very confused when they're not present</p>



<a name="216241819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241819">(Nov 10 2020 at 17:07)</a>:</h4>
<p>I agree 100% that building <code>rustc</code> (the binary) and the standard library requires a special procedure. However, if I didn't modified the API/ABI of either, I should be able to use, at least, the current nightly toolchain to build any part of the rustc repo.</p>



<a name="216241863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241863">(Nov 10 2020 at 17:07)</a>:</h4>
<p>you can, and you just did</p>



<a name="216241935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216241935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216241935">(Nov 10 2020 at 17:08)</a>:</h4>
<p>and if you <code>cd compiler/rustc &amp;&amp; cargo build</code> that also works (with some caveats)</p>



<a name="216242208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242208">(Nov 10 2020 at 17:10)</a>:</h4>
<p>No, I didn't, I spend 5+ hours to be able to do a 5 lines modification in a Cargo.toml in a directory that have the sources at the root, and not inside a <code>src</code> or <code>lib</code> subdirectory, I had to not use clippy, because I got way to many warning, and I had to understand the concept of sysroot. I really don't think that I <em>just</em> did it.</p>



<a name="216242249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242249">(Nov 10 2020 at 17:10)</a>:</h4>
<p>right, yes - but these are problems cargo can't help with</p>



<a name="216242271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242271">(Nov 10 2020 at 17:10)</a>:</h4>
<p>at <em>some</em> point you have to deal with the fact that there are two different sysroots</p>



<a name="216242323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242323">(Nov 10 2020 at 17:11)</a>:</h4>
<p>note that x.py was <em>nowhere</em> in this build process</p>



<a name="216242327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242327">(Nov 10 2020 at 17:11)</a>:</h4>
<p>But to be honest, it's probably that the rust project start to get old, and get such kind of defect that only age can explain ;)</p>



<a name="216242337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242337">(Nov 10 2020 at 17:11)</a>:</h4>
<p>this is inherent complexity, not accidental</p>



<a name="216242563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242563">(Nov 10 2020 at 17:12)</a>:</h4>
<p>at least, inherent to using rustc_private</p>



<a name="216242588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242588">(Nov 10 2020 at 17:13)</a>:</h4>
<p>using rust-analyzer would probably be a lot easier</p>



<a name="216242653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242653">(Nov 10 2020 at 17:13)</a>:</h4>
<p>Why should it be [inherent complexity], I don't need to boostrap anything. I modified neither rustc, nor the standard library</p>



<a name="216242738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242738">(Nov 10 2020 at 17:14)</a>:</h4>
<p>because you're linking to rustc itself</p>



<a name="216242776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242776">(Nov 10 2020 at 17:14)</a>:</h4>
<p>it no longer knows where artifacts go</p>



<a name="216242846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242846">(Nov 10 2020 at 17:15)</a>:</h4>
<p>But I don't need to boostrap anything, I'm using a nightly compiler, so my toolchain is already up-to-date (my clone of the rustc repo is older than the build of my toolchain).</p>



<a name="216242867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242867">(Nov 10 2020 at 17:15)</a>:</h4>
<p>let me put it differently</p>



<a name="216242899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242899">(Nov 10 2020 at 17:15)</a>:</h4>
<p>you effectively ran <code>rustc -lrustc lib.rs</code></p>



<a name="216242921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242921">(Nov 10 2020 at 17:15)</a>:</h4>
<p>rustc is <em>both</em> building <em>and</em> being linked to your project</p>



<a name="216242957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242957">(Nov 10 2020 at 17:16)</a>:</h4>
<p>I just noticed you were trying to build the rustdoc library found at <code>src/librustdoc</code> as if it was an executable, not the rustdoc executable found at <code>src/tools/rustdoc</code>.</p>



<a name="216242967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216242967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216242967">(Nov 10 2020 at 17:16)</a>:</h4>
<p>so there's two places with artifacts: the outputs from rustc, and the rustc shared object file</p>



<a name="216243112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216243112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216243112">(Nov 10 2020 at 17:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F/near/216242957">said</a>:</p>
<blockquote>
<p>I just noticed you were trying to build the rustdoc library found at <code>src/librustdoc</code> as if it was an executable, not the rustdoc executable found at <code>src/tools/rustdoc</code>.</p>
</blockquote>
<p>I mean, the one in src/tools/rustdoc doesn't actually do anything lol</p>



<a name="216243122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216243122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216243122">(Nov 10 2020 at 17:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F/near/216242957">said</a>:</p>
<blockquote>
<p>I just noticed you were trying to build the rustdoc library found at <code>src/librustdoc</code> as if it was an executable, not the rustdoc executable found at <code>src/tools/rustdoc</code>.</p>
</blockquote>
<p>Yes, I had no idea where it would be. And given that there is a main, I thought it would be easier to start from there. Maybe I was wrong.</p>



<a name="216243162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216243162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216243162">(Nov 10 2020 at 17:17)</a>:</h4>
<p>like, this is the whole file:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">rustdoc</span>::<span class="n">main</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216243331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216243331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216243331">(Nov 10 2020 at 17:18)</a>:</h4>
<p>That is the same as <code>compiler/rustc</code> almost only calling <code>rustc_driver::main();</code>.</p>



<a name="216244599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244599">(Nov 10 2020 at 17:28)</a>:</h4>
<p>That's weird. If I build from librustdoc, I need to add <code>lazy_static</code> and <code>tracing</code> in the dependencies in the <code>Cargo.toml</code>, but not when compiling from <code>tools/rustdoc</code>.</p>



<a name="216244664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244664">(Nov 10 2020 at 17:28)</a>:</h4>
<p>Also, should I create a PR to add the sysroot detection, like what is done in miri? This would allow to run a version of <code>rustdoc</code> build without <code>x.py</code>.</p>



<a name="216244869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244869">(Nov 10 2020 at 17:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281841">Robin Moussu</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F/near/216244599">said</a>:</p>
<blockquote>
<p>That's weird. If I build from librustdoc, I need to add <code>lazy_static</code> and <code>tracing</code> in the dependencies in the <code>Cargo.toml</code>, but not when compiling from <code>tools/rustdoc</code>.</p>
</blockquote>
<p>tools/rustdoc already has them in the sysroot I think</p>



<a name="216244893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244893">(Nov 10 2020 at 17:30)</a>:</h4>
<p>since rustc depends on them too</p>



<a name="216244914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244914">(Nov 10 2020 at 17:30)</a>:</h4>
<p>ah</p>



<a name="216244941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244941">(Nov 10 2020 at 17:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281841">Robin Moussu</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F/near/216244664">said</a>:</p>
<blockquote>
<p>Also, should I create a PR to add the sysroot detection, like what is done in miri? This would allow to run a version of <code>rustdoc</code> build without <code>x.py</code>.</p>
</blockquote>
<p>hmm I'm not <em>opposed</em> to it but I'd want to be sure it doesn't break x.py</p>



<a name="216244958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244958">(Nov 10 2020 at 17:31)</a>:</h4>
<p>of course!</p>



<a name="216244970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216244970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216244970">(Nov 10 2020 at 17:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> probably has stronger opinions though</p>



<a name="216245060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245060">(Nov 10 2020 at 17:31)</a>:</h4>
<p>but yeah I think we'd need this anyway to build rustdoc out of tree</p>



<a name="216245381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245381">(Nov 10 2020 at 17:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281841">Robin Moussu</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F/near/216244599">said</a>:</p>
<blockquote>
<p>That's weird. If I build from librustdoc, I need to add <code>lazy_static</code> and <code>tracing</code> in the dependencies in the <code>Cargo.toml</code>, but not when compiling from <code>tools/rustdoc</code>.</p>
</blockquote>
<p>see also <a href="https://github.com/rust-lang/rust/blob/master/src/librustdoc/lib.rs#L24-L30">https://github.com/rust-lang/rust/blob/master/src/librustdoc/lib.rs#L24-L30</a></p>



<a name="216245385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245385">(Nov 10 2020 at 17:34)</a>:</h4>
<p>and what version of <code>lazy_static</code> + <code>tracing</code>. This doesn't seem to be unified in the repository</p>



<a name="216245421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245421">(Nov 10 2020 at 17:34)</a>:</h4>
<p>I don't follow - those should still be loaded from sysroot</p>



<a name="216245478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245478">(Nov 10 2020 at 17:35)</a>:</h4>
<p>otherwise x.py will build them twice</p>



<a name="216245506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245506">(Nov 10 2020 at 17:35)</a>:</h4>
<p>I've never looked in detail at the code miri uses, so can't really comment</p>



<a name="216245601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245601">(Nov 10 2020 at 17:35)</a>:</h4>
<p>rustdoc deps shared with rustc are indeed ideally not declared in cargo.toml and just loaded from sysroot</p>



<a name="216245781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245781">(Nov 10 2020 at 17:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F/near/216245421">said</a>:</p>
<blockquote>
<p>I don't follow - those should still be loaded from sysroot</p>
</blockquote>
<p>Effectively, my memory was bad. I though I had to add them to be able to build, but if fact no.</p>



<a name="216245970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216245970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216245970">(Nov 10 2020 at 17:38)</a>:</h4>
<p>And if I add that sysroot detection, should I copy-paste the code from miri, or is there some common library where I could copy the code of <code>compile_time_sysroot()</code>?</p>



<a name="216246127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216246127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216246127">(Nov 10 2020 at 17:39)</a>:</h4>
<p>any common library wouldn't be present out-of-tree, so I don't think that would help</p>



<a name="216246149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216246149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216246149">(Nov 10 2020 at 17:39)</a>:</h4>
<p>e.g. if you put it in <code>src/build_helper</code> miri wouldn't be able to use it</p>



<a name="216246257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216246257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216246257">(Nov 10 2020 at 17:40)</a>:</h4>
<p>I guess we could make it a git dependency but that seems like overkill</p>



<a name="216246263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216246263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216246263">(Nov 10 2020 at 17:40)</a>:</h4>
<p>ok, so dupplication + comment in both place</p>



<a name="216247420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216247420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216247420">(Nov 10 2020 at 17:50)</a>:</h4>
<p>I would like to review that bit, btw, so please ping me on the eventual PR</p>



<a name="216250046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216250046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216250046">(Nov 10 2020 at 18:06)</a>:</h4>
<p>sure</p>



<a name="216252245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252245">(Nov 10 2020 at 18:23)</a>:</h4>
<p>Given that miri isn't on the same repo, should I add create commit just to add a comment to say that the code of the sysroot detection was copied in rustdoc? I assume I shouldn't.</p>



<a name="216252716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252716">(Nov 10 2020 at 18:26)</a>:</h4>
<p>Hmm, does miri use submodules or subtrees?</p>



<a name="216252755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252755">(Nov 10 2020 at 18:26)</a>:</h4>
<p>If it uses submodules I'd make the change upstream in rust-lang/miri, after the rustdoc pr gets merged</p>



<a name="216252783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252783">(Nov 10 2020 at 18:27)</a>:</h4>
<p>I think submodule. I'm not sure, and don't know how to check. Ok, I will do.</p>



<a name="216252911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252911">(Nov 10 2020 at 18:28)</a>:</h4>
<p><code>git submodule</code> will list all submodules in the repo</p>



<a name="216252979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252979">(Nov 10 2020 at 18:28)</a>:</h4>
<p>Looks like it is a submodule, yeah</p>



<a name="216252989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216252989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216252989">(Nov 10 2020 at 18:28)</a>:</h4>
<p>It is.</p>



<a name="216253222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216253222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216253222">(Nov 10 2020 at 18:30)</a>:</h4>
<p>What is the syntax in the PR to ping someone?</p>



<a name="216253806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216253806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216253806">(Nov 10 2020 at 18:34)</a>:</h4>
<p><code>r? @simulacrum</code></p>



<a name="216253856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216253856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216253856">(Nov 10 2020 at 18:34)</a>:</h4>
<p>Thx</p>



<a name="216253887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216253887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216253887">(Nov 10 2020 at 18:35)</a>:</h4>
<p>(but also cc me please, I'm @jyn514)</p>



<a name="216253982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216253982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216253982">(Nov 10 2020 at 18:35)</a>:</h4>
<p>should I put both name on the same line?</p>



<a name="216254136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216254136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216254136">(Nov 10 2020 at 18:36)</a>:</h4>
<p>separate lines - the first <code>r?</code> is parsed by @bors, anything after is just a normal ping</p>



<a name="216254156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216254156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216254156">(Nov 10 2020 at 18:36)</a>:</h4>
<p>ok</p>



<a name="216254624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20create%20an%20executable%20accessing%20%60rustc_private%60%3F/near/216254624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F.html#216254624">(Nov 10 2020 at 18:40)</a>:</h4>
<p>done</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>